<template>
    <div>
        <!-- 系统设置 -->
        <div class="all-container">
            <!-- 标签页 -->
            <el-row class="os-tab-container">
                <el-col :span="24">
                    <el-tabs v-model="osActive" type="card" class="os_nav">
                        <el-tab-pane label="实名制管理" name="1">
                            <div class="tab-win">
                                <el-row>
                                    <!-- 左侧栏 -->
                                    <el-col :span="11">
                                        <!-- 第一行 -->
                                        <el-row class="os-row">
                                            <el-col :span="24">
                                                <div class="choose-title lf">身份证信息校验方式</div>
                                                <i class="el-icon-question logo lf" style="margin-right: 30px;"></i>
                                                <!--<dropDown :cv="isChecked" :ci="checkList" :wt="checkWid"></dropDown><br>-->
                                                <el-form ref="form">
                                                    <el-form-item label="">
                                                        <el-select v-model="region" placeholder="" size="mini">
                                                            <el-option label="检验" value="1"></el-option>
                                                            <el-option label="不检验" value="0"></el-option>
                                                        </el-select>
                                                    </el-form-item>
                                                </el-form>
                                            </el-col>
                                        </el-row>
                                        <!-- 第二行 -->
                                        <el-row class="os-row">
                                            <el-col :span="24">
                                                <div class="choose-title lf">窗口售出票自动标记为已核验</div>
                                                <el-switch v-model="autoChecked" active-color="#009688"
                                                           inactive-color="#CFCFCF" class="rf"></el-switch>
                                            </el-col>
                                        </el-row>
                                        <!-- 第三行 -->
                                        <el-row class="os-row">
                                            <el-col :span="24">
                                                <div class="choose-title lf">只限从身份证阅读器读取才自动标记为已核验</div>
                                                <el-switch v-model="matChecked" active-color="#009688"
                                                           inactive-color="#CFCFCF" class="rf"></el-switch>
                                            </el-col>
                                        </el-row>
                                        <!-- 第四行 -->
                                        <el-row class="os-row">
                                            <el-col :span="24">
                                                <div class="choose-title lf">身份证阅读机具品牌</div>
                                                <!--<dropDown :cv="readChoose" :ci="readList" :wt="readWid"></dropDown>-->
                                                <el-form ref="form">
                                                    <el-form-item label="">
                                                        <el-select v-model="readChoose" placeholder="" size="mini">
                                                            <el-option label="无" value="0"></el-option>
                                                            <el-option label="新中新 - A16D" value="1"></el-option>
                                                            <el-option label="普天邮通-CP IDMRO2/TG" value="2"></el-option>
                                                            <el-option label="神州海纳 - BP900S" value="3"></el-option>
                                                            <el-option label="永军 - NVR-100" value="4"></el-option>
                                                        </el-select>
                                                    </el-form-item>
                                                </el-form>
                                            </el-col>

                                        </el-row>
                                    </el-col>
                                    <!-- 右侧栏 -->
                                    <el-col :span="11" :offset="2">
                                        <!-- 第一行 -->
                                        <el-row class="os-row">
                                            <el-col :span="24">
                                                <div class="choose-title lf">免票儿童实名信息单独打印在一张车票</div>
                                                <i class="el-icon-question logo lf"></i>
                                                <el-switch v-model="childPrint" active-color="#009688"
                                                           inactive-color="#CFCFCF" class="rf"></el-switch>
                                            </el-col>
                                        </el-row>
                                        <!-- 第二行 -->
                                        <el-row class="os-row">
                                            <el-col :span="24">
                                                <div class="choose-title lf">检票时自动完成票证核验</div>
                                                <i class="el-icon-question logo lf"></i>
                                                <el-switch v-model="autoCom" active-color="#009688"
                                                           inactive-color="#CFCFCF" class="rf"></el-switch>
                                            </el-col>
                                        </el-row>
                                        <!-- 第三行 -->
                                        <el-row class="os-row">
                                            <el-col :span="24">
                                                <div class="choose-title lf">未完成票证核验不允许检票</div>
                                                <i class="el-icon-question logo lf"></i>
                                                <el-switch v-model="allowChecked" active-color="#009688"
                                                           inactive-color="#CFCFCF" class="rf"></el-switch>
                                            </el-col>
                                        </el-row>
                                    </el-col>
                                </el-row>
                                <div class="cb"></div>
                            </div>
                        </el-tab-pane>
                        <el-tab-pane label="售票模块" name="2">
                            <div class="tab-win">
                                <el-row>
                                    <!-- 左侧栏 -->
                                    <el-col :span="11">
                                        <!-- 第一行 -->
                                        <el-row class="os-row">
                                            <el-col :span="24">
                                                <div class="choose-title lf">启用南粤移动支付功能</div>
                                                <el-switch v-model="nanPay" active-color="#009688"
                                                           inactive-color="#CFCFCF" class="rf"></el-switch>
                                            </el-col>
                                        </el-row>
                                        <!-- 第二行 -->
                                        <el-row class="os-row">
                                            <el-col :span="24">
                                                <div class="choose-title lf">启用实名制购票功能</div>
                                                <el-switch v-model="namePay" active-color="#009688"
                                                           inactive-color="#CFCFCF" class="rf"></el-switch>
                                            </el-col>
                                        </el-row>
                                        <!-- 第三行 -->
                                        <el-row class="os-row">
                                            <el-col :span="24">
                                                <div class="choose-title lf">售票必须进行实名制登记</div>
                                                <i class="el-icon-question logo lf"></i>
                                                <el-switch v-model="mustName" active-color="#009688"
                                                           inactive-color="#CFCFCF" class="rf"></el-switch>
                                            </el-col>
                                        </el-row>
                                        <!-- 第四行 -->
                                        <el-row class="os-row">
                                            <el-col :span="24">
                                                <div class="choose-title lf">免票儿童必须实名登记信息</div>
                                                <el-switch v-model="childMustName" active-color="#009688"
                                                           inactive-color="#CFCFCF" class="rf"></el-switch>
                                            </el-col>
                                        </el-row>
                                        <!-- 第五行 -->
                                        <el-row class="os-row">
                                            <el-col :span="24">
                                                <div class="choose-title lf">实名制登记界面允许直接出票</div>
                                                <el-switch v-model="allowOut" active-color="#009688"
                                                           inactive-color="#CFCFCF" class="rf"></el-switch>
                                            </el-col>
                                        </el-row>
                                        <!-- 第六行 -->
                                        <el-row class="os-row">
                                            <el-col :span="24">
                                                <div class="choose-title lf">启用系统内保险销售接口</div>
                                                <i class="el-icon-question logo lf"></i>
                                                <el-switch v-model="insurance" active-color="#009688"
                                                           inactive-color="#CFCFCF" class="rf"></el-switch>
                                            </el-col>
                                        </el-row>
                                        <!-- 第七行 -->
                                        <el-row class="os-row">
                                            <el-col :span="24">
                                                <div class="choose-title lf">提前截至售票时间</div>
                                                <i class="el-icon-question logo lf"></i>
                                                <div class="choose-title rf">分</div>
                                                <el-input v-model="input" placeholder="" size="mini" style="width:80px"
                                                          class="rf time-input"></el-input>
                                            </el-col>
                                        </el-row>
                                        <!-- 第八行 -->
                                        <el-row class="os-row">
                                            <el-col :span="24">
                                                <div class="choose-title lf">默认显示班次座位</div>
                                                <i class="el-icon-question logo lf"></i>
                                                <el-switch v-model="showSeat" active-color="#009688"
                                                           inactive-color="#CFCFCF" class="rf"></el-switch>
                                            </el-col>
                                        </el-row>
                                        <el-row class="os-row">
                                            <el-col :span="24">
                                                <div class="choose-title lf">收款框默认为应收金额</div>
                                                <i class="el-icon-question logo lf"></i>
                                                <el-switch v-model="indexPrice" active-color="#009688"
                                                           inactive-color="#CFCFCF" class="rf"></el-switch>
                                            </el-col>
                                        </el-row>
                                        <el-row class="os-row">
                                            <el-col :span="24">
                                                <div class="choose-title lf">显示班次途经站及票价明细</div>
                                                <i class="el-icon-question logo lf"></i>
                                                <el-switch v-model="showPrice" active-color="#009688"
                                                           inactive-color="#CFCFCF" class="rf"></el-switch>
                                            </el-col>
                                        </el-row>
                                        <el-row class="os-row">
                                            <el-col :span="24">
                                                <div class="choose-title lf">输入全票数量后下一步调到收款框</div>
                                                <i class="el-icon-question logo lf"></i>
                                                <el-switch v-model="nextToPay" active-color="#009688"
                                                           inactive-color="#CFCFCF" class="rf"></el-switch>
                                            </el-col>
                                        </el-row>
                                        <el-row class="os-row">
                                            <el-col :span="24">
                                                <div class="choose-title lf">启用退票凭证打印功能</div>
                                                <i class="el-icon-question logo lf"></i>
                                                <el-switch v-model="openPrice" active-color="#009688"
                                                           inactive-color="#CFCFCF" class="rf"></el-switch>
                                            </el-col>
                                        </el-row>
                                        <el-row class="os-row">
                                            <el-col :span="24">
                                                <div class="choose-title lf">班次列表列出零余座班次</div>
                                                <i class="el-icon-question logo lf"></i>
                                                <el-switch v-model="showClass" active-color="#009688"
                                                           inactive-color="#CFCFCF" class="rf"></el-switch>
                                            </el-col>
                                        </el-row>
                                    </el-col>
                                    <!-- 右侧栏 -->
                                    <el-col :span="11" :offset="2">
                                        <el-row class="os-row">
                                            <el-col :span="24">
                                                <div class="choose-title lf">班次列表列出零票价班次</div>
                                                <el-switch v-model="showClass1" active-color="#009688"
                                                           inactive-color="#CFCFCF" class="rf"></el-switch>
                                            </el-col>
                                        </el-row>
                                        <el-row class="os-row">
                                            <el-col :span="24">
                                                <div class="choose-title lf">班次列表列出停班班次</div>
                                                <el-switch v-model="stopClass" active-color="#009688"
                                                           inactive-color="#CFCFCF" class="rf"></el-switch>
                                            </el-col>
                                        </el-row>
                                        <el-row class="os-row">
                                            <el-col :span="24">
                                                <div class="choose-title lf">补票状态列出全部班次</div>
                                                <i class="el-icon-question logo lf"></i>
                                                <el-switch v-model="showAllClass" active-color="#009688"
                                                           inactive-color="#CFCFCF" class="rf"></el-switch>
                                            </el-col>
                                        </el-row>
                                        <el-row class="os-row">
                                            <el-col :span="24">
                                                <div class="choose-title lf">按票段拆分售票日汇总单</div>
                                                <i class="el-icon-question logo lf"></i>
                                                <el-switch v-model="priceList" active-color="#009688"
                                                           inactive-color="#CFCFCF" class="rf"></el-switch>
                                            </el-col>
                                        </el-row>
                                        <el-row class="os-row">
                                            <el-col :span="24">
                                                <div class="choose-title lf">允许跨线路改签</div>
                                                <el-switch v-model="crossRoad" active-color="#009688"
                                                           inactive-color="#CFCFCF" class="rf"></el-switch>
                                            </el-col>
                                        </el-row>
                                        <el-row class="os-row">
                                            <el-col :span="24">
                                                <div class="choose-title lf">截至废票时间</div>
                                                <i class="el-icon-question logo lf"></i>
                                                <div class="choose-title rf">分(默认为-1)</div>
                                                <el-input v-model="abanTime" placeholder="" size="mini"
                                                          style="width:80px" class="rf time-input"></el-input>
                                            </el-col>
                                        </el-row>
                                        <el-row class="os-row">
                                            <el-col :span="24">
                                                <div class="choose-title lf">默认退票费率</div>
                                                <i class="el-icon-question logo lf"></i>
                                                <div class="choose-title rf">%(默认为-1)</div>
                                                <el-input v-model="abanprice" placeholder="" size="mini"
                                                          style="width:80px" class="rf time-input"></el-input>
                                            </el-col>
                                        </el-row>
                                        <el-row class="os-row">
                                            <el-col :span="24">
                                                <div class="choose-title lf">退废票使用票号/条码</div>
                                                <div class="choose-title rf aban-input2">条码</div>
                                                <el-switch v-model="abanType" active-color="#009688"
                                                           inactive-color="#CFCFCF" class="rf"></el-switch>
                                                <div class="choose-title rf aban-input">票号</div>
                                            </el-col>
                                        </el-row>
                                        <el-row class="os-row">
                                            <el-col :span="24">
                                                <div class="choose-title lf">单次售票操作车票数量上限</div>
                                                <div class="choose-title rf">张</div>
                                                <el-input v-model="maxBuy" placeholder="" size="mini" style="width:80px"
                                                          class="rf time-input"></el-input>
                                            </el-col>
                                        </el-row>
                                        <el-row class="os-row">
                                            <el-col :span="24">
                                                <div class="choose-title lf">单次退票操作车票数量上限</div>
                                                <div class="choose-title rf">张</div>
                                                <el-input v-model="maxRebuy" placeholder="" size="mini"
                                                          style="width:80px" class="rf time-input"></el-input>
                                            </el-col>
                                        </el-row>
                                        <el-row class="os-row">
                                            <el-col :span="24">
                                                <div class="choose-title lf">单次废票操作车票数量上限</div>
                                                <div class="choose-title rf">张</div>
                                                <el-input v-model="maxAban" placeholder="" size="mini"
                                                          style="width:80px" class="rf time-input"></el-input>
                                            </el-col>
                                        </el-row>
                                        <el-row class="os-row">
                                            <el-col :span="24">
                                                <div class="choose-title lf">车票条码类型</div>
                                                <!--<dropDown :cv="carNumType" :ci="carNumTypeList"
                                                         :wt="checkWid"></dropDown>
                                               <br>-->
                                                <el-form ref="form" class="rf" style="margin-right: 30px;">
                                                    <el-form-item label="">
                                                        <el-select v-model="carNumType" placeholder="" size="mini">
                                                            <el-option label="128C" value="0"></el-option>
                                                            <el-option label="EAN13" value="1"></el-option>
                                                            <el-option label="ITF25" value="2"></el-option>
                                                        </el-select>
                                                    </el-form-item>
                                                </el-form>
                                            </el-col>
                                        </el-row>
                                    </el-col>
                                </el-row>
                                <div class="cb"></div>
                            </div>
                        </el-tab-pane>
                        <el-tab-pane label="订票模块" name="3">角色管理</el-tab-pane>
                        <el-tab-pane label="调度模块" name="4">定时任务补偿</el-tab-pane>
                        <el-tab-pane label="财务模块" name="5">定时任务补偿</el-tab-pane>
                        <el-tab-pane label="安检模块" name="6">定时任务补偿</el-tab-pane>
                        <el-tab-pane label="验票模块" name="7">定时任务补偿</el-tab-pane>
                        <el-tab-pane label="系统自动作业" name="8">定时任务补偿</el-tab-pane>
                    </el-tabs>
                </el-col>
            </el-row>
        </div>
    </div>
</template>

<script>
    import dropDown from "../../components/common/dropdown"

    export default {
        data: function () {
            return {
                region: '',
                osActive: "1",
                isChecked: "0",
                checkList: [
                    {
                        label: "检验",
                        value: "1"
                    },
                    {
                        label: "不检验",
                        value: "0"
                    },
                ],
                checkWid: {
                    width: "100px",
                    paddingLeft: "30px",
                    float: "right"
                },
                autoChecked: "",
                matChecked: "",
                readChoose: "",
                readWid: {
                    width: "200px",
                    paddingLeft: "30px",
                    float: "right"
                },
                readList: [
                    {
                        label: "普天邮通-CP IDMRO2/TG",
                        value: "1"
                    },
                    {
                        label: "普天邮通-CP IDMRO2/TG",
                        value: "2"
                    },
                    {
                        label: "普天邮通-CP IDMRO2/TG",
                        value: "3"
                    },
                ],
                childPrint: false,
                autoCom: true,
                allowChecked: false,
                nanPay: true,
                namePay: true,
                mustName: true,
                childMustName: false,
                allowOut: true,
                insurance: true,
                showSeat: true,
                indexPrice: false,
                showPrice: false,
                nextToPay: true,
                openPrice: true,
                showClass: true,
                stopClass: true,
                showAllClass: false,
                priceList: false,
                crossRoad: true,
                abanTime: "",
                abanprice: "",
                abanType: true,
                maxBuy: "",
                maxRebuy: "",
                maxAban: "",
                carNumType: "",
                carNumTypeList: [
                    {
                        label: "128C",
                        value: "128"
                    },
                    {
                        label: "129C",
                        value: "129"
                    },
                    {
                        label: "130C",
                        value: "130"
                    },
                ]
            };
        },
        methods: {
            getUpdate(v1, v2) {
                this.postRequest('/sys/preferences/update?sysPreferences.id=' + v1 + '&sysPreferences.value=' + Number(v2) + '')
                    .then(data => {
                        this.$message.success(data.data[1]);
                    });
            },
        },
        computed: {},
        components: {dropDown},
        watch: {
            region() {
                this.getUpdate('423', this.region);
            },
            childPrint() {//没有接口
                this.$message.error('没有接口');
                // console.log(this.childPrint);
                // this.getUpdate('423',this.region);
            },
            autoChecked() {
                this.getUpdate('422', this.autoChecked);
            },
            autoCom() {
                this.getUpdate('438', this.autoCom);
            },
            matChecked() {
                this.getUpdate('437', this.matChecked);
            },
            allowChecked() {
                this.getUpdate('439', this.matChecked);
            },
            readChoose() {
                this.getUpdate('194', this.readChoose);
            },

            /*售票模块左侧一列*/
            nanPay() {
                this.getUpdate('350', this.nanPay);
            },
            namePay() {
                this.getUpdate('421', this.namePay);
            },
            mustName() {
                this.getUpdate('429', this.namePay);
            },
            childMustName() {
                this.$message.error('没有接口');
                // this.getUpdate('429',this.childMustName );//4
            },
            allowOut() {
                this.getUpdate('300', this.allowOut);
            },
            insurance() {
                this.getUpdate('430', this.insurance);
            },
            input() {
                this.getUpdate('9', this.input);
            },
            showSeat() {
                this.getUpdate('2', this.showSeat);
            },
            indexPrice() {
                this.getUpdate('3', this.indexPrice);
            },
            showPrice() {
                this.getUpdate('441', this.showPrice);
            },
            nextToPay() {
                this.getUpdate('5', this.nextToPay);
            },
            openPrice() {
                this.getUpdate('39', this.openPrice);
            },
            showClass() {
                this.getUpdate('6', this.showClass);
            },
            /*售票模块左侧一列*/

            /*售票模块右侧一列*/
            showClass1() {
                this.getUpdate('7', this.showClass1);
            },
            stopClass() {
                this.getUpdate('8', this.stopClass);
            },
            showAllClass() {
                this.getUpdate('169', this.showAllClass);
            },
            priceList() {
                this.getUpdate('440', this.priceList);
            },
            crossRoad() {
                this.getUpdate('23', this.crossRoad);
            },
            abanTime() {
                this.getUpdate('89', this.abanTime);
            },
            abanprice() {
                this.getUpdate('85', this.abanprice);
            },
            abanType() {
                this.getUpdate('10', this.abanType);
            },
            maxBuy() {
                this.getUpdate('443', this.maxBuy);
            },
            maxRebuy() {
                this.getUpdate('11', this.maxRebuy);
            },
            maxAban() {
                this.getUpdate('12', this.maxAban);
            },
            carNumType() {
                this.$message.error('没有接口');
                // this.getUpdate('167',this.carNumType);
            },
            /*售票模块右侧一列*/

        },
        mounted() {
            console.log("osManage");
            this.$emit("sendActive", "3-1");
        }
    };
</script>
<style scoped src="../../assets/css/allManage/osManage.css">
</style>